#pragma once

#include <stdexcept>
#include <ostream>
#include "index-item.h"
#include "uri-path.h"


namespace book
{

class ChapterMenuConvert
{
public:

    class StreamError : public std::logic_error
    {
    public:
        StreamError() : std::logic_error("ChapterMenuConvert got bat output stream") {}
        virtual ~StreamError() {}
    };

    ChapterMenuConvert(std::ostream &out);

    ~ChapterMenuConvert();

    void feed(const UriPath &uri, const IndexItem &indexItem);

private:
    std::ostream &out_;
};

} // namespace book
